import { FC, lazy, Suspense } from 'react'
interface LazyWrapperProps {
  url: string
}
const LazyWrapper: FC<LazyWrapperProps> = ({ url }) => {
  const LazyComponent = lazy(() => import(`@/components/${url}`))
  return (
    <Suspense fallback={<div>loading...</div>}>
      <LazyComponent />
    </Suspense>
  )
}
export default LazyWrapper
